<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户列表</title>
<script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/pageCommon.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/PageUtils.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/DemoData.js" charset="utf-8"></script>
	<script language="javascript" src="${pageContext.request.contextPath}/script/DataShowManager.js" charset="utf-8"></script>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/pageCommon.css" />
    <script type="text/javascript">
    </script>
</head>
<body>

<div id="Title_bar">
    <div id="Title_bar_Head"> 
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 用户管理
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<div id="MainArea">
    <table cellspacing="0" cellpadding="0" class="TableStyle">
       
        <!-- 表头-->
        <thead>
            <tr align=center valign=middle id=TableTitle>
                <td width="100">序号</td>
                <td width="100">登录名</td>
                <td width="100">姓名</td>
                <td width="100">部门</td>
                <td width="100">激活状态</td>
                <td>相关操作</td>
            </tr>
        </thead>
        
        <!--显示数据列表-->
        <tbody id="TableData">
        	<c:if test="${list!=null && list.size()>0 }">
        		<c:forEach items="${list }" var="u1" varStatus="s1">
        			<tr class="TableDetail1 template">
		                <td>${s1.count}&nbsp;</td>
		                <td>${u1.loginName}&nbsp;</td>
		                <td>${u1.userDetail.name}&nbsp;</td>
		                <td>${u1.userDetail.dept.name}&nbsp;</td>
		                <td>
		                	<c:choose>
		                		<c:when test="${u1.isActive==1 }">激活</c:when>
		                		<c:otherwise>禁用</c:otherwise>
		                	</c:choose>
		                </td>
		                <td>
		                	<!-- 
		                		如果当前记录是激活状态的，那么超链接就显示为禁用
		                	    如果当前记录是禁用状态的，那么超链接就显示为激活
		                	 -->
		                	<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=updateIsActive&userId=${u1.id}&isAcitve=${u1.isActive==1?0:1 }">${u1.isActive==1?"禁用":"激活" }</a>
		                    <a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=loadData&fromMode=update&userId=${u1.id}">修改</a>
							<a href="#" onClick="return window.confirm('您确定要初始化密码为1234吗？')">初始化密码</a>
		                </td>
		            </tr>
        		</c:forEach>
        	</c:if>
        </tbody>
    </table>
    
    <!--分页信息-->
	<div id=PageSelectorBar>
		<div id=PageSelectorMemo>
			页次：${pageBean.pageIndex }/${pageBean.pageCount }页 &nbsp;
			每页显示：${pageBean.pageSize }条 &nbsp;
			总记录数：${pageBean.totalCount }条
			
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<c:choose>
				<c:when test="${pageBean.pageIndex<=1 }">
					<label>首页</label>&nbsp;
					<label>上一页</label>&nbsp;
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=${pageBean.pageIndex+1 }" style="cursor: hand;color:blue;">下一页</a>&nbsp;
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=${pageBean.pageCount }" style="cursor: hand;color:blue;">末页</a>
				</c:when>
				<c:when test="${pageBean.pageIndex<pageBean.pageCount }">
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=1" style="cursor: hand;color:blue;">首页</a>&nbsp;
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=${pageBean.pageIndex-1 }" style="cursor: hand;color:blue;">上一页</a>&nbsp;
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=${pageBean.pageIndex+1 }" style="cursor: hand;color:blue;">下一页</a>&nbsp;
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=${pageBean.pageCount }" style="cursor: hand;color:blue;">末页</a>
				</c:when>
				<c:otherwise>
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=1" style="cursor: hand;color:blue;">首页</a>&nbsp;
					<a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=list&pageIndex=${pageBean.pageIndex-1 }" style="cursor: hand;color:blue;">上一页</a>&nbsp;
					<label>下一页</label>&nbsp;&nbsp;
					<label>末页</label>&nbsp;&nbsp;
				</c:otherwise>
			</c:choose>
		</div>
		<div id=PageSelectorSelectorArea>
		</div>
	</div>
    
    <!-- 其他功能超链接 -->
    <div id="TableTail">
        <div id="TableTail_inside">
            <a href="${pageContext.request.contextPath}/jsp/sys/zwl/user/userServlet?opr=loadData&fromMode=add"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a>
        </div>
    </div>
</div>

</body>
</html>